package com.supreme.commonmongo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;

import javax.annotation.PostConstruct;

@SpringBootConfiguration
@EnableMongoRepositories(value = {"com.supreme.commonmongo.mapper"})
@PropertySource(value = {"classpath:mongo-module.properties"}, encoding = "UTF-8")
public class SupremeCommonMongoModule {

    @Value("${supreme-module.name}")
    private String moduleName;

    @PostConstruct
    private void initMongoModule() {
        System.out.println("initMongoModule: " + moduleName);
    }
}
